/**
 * SQL 查询服务类。 在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
 * @see http://iclient.supermap.io/libs/iclient8c/apidoc/files/SuperMap/REST/Query/QueryBySQLService-js.html
 * @param {string} url 
 * @param {*} { customParams, networkType, queryOption, queryParams, startRecord = 0, expectCount = 5000, holdTime, returnContent } 
 */
export function queryBySQLService(url, { customParams, networkType, queryOption, queryParams, startRecord = 0, expectCount = 5000, holdTime, returnContent }) {
    let queryBySQLParams = new SuperMap.REST.QueryBySQLParameters({
        customParams,
        networkType,
        queryOption,
        queryParams,
        startRecord,
        expectCount,
        holdTime,
        returnContent
    });
    return new Promise((resolve, reject) => {
        var myQueryBySQLService = new SuperMap.REST.QueryBySQLService(url, {
            eventListeners: {
                'processCompleted': resolve,
                'processFailed': reject
            }
        })
        myQueryBySQLService.processAsync(queryBySQLParams)
    })
}